<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="his_fns" uri="/WEB-INF/tlds/his_fns.tld" %>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugPlanCheck/index')">采购计划查询</a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <div class="datatable-top">
                        <div class="pull-left">
                            <form:form id="searchForm" modelAttribute="drugBuyPlan"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugPlanCheck/index');" method="post" class="form-inline">
                                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                <div class="form-group">
                                    <label class="control-label">采购单号:</label>
                                    <form:select path="purchaseNumber" id="purchaseNumber" htmlEscape="false" class="form-control" data-parsley-required="true">
                                        <form:option value=""></form:option>
                                        <form:options items="${his_fns:getBuyPlanNum('4')}" itemLabel="purchaseNumber" itemValue="purchaseNumber" htmlEscape="false" />
                                    </form:select>
                                </div>
                                <%--<div class="form-group"><label>药品名称:&nbsp;&nbsp;</label><form:input path="drugName" maxlength="50" class="form-control"></form:input></div>--%>
                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                            </form:form>
                        </div>
                    </div>
                    <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>药品代码</th>
                            <th>药品名称</th>
                            <th>包装规格</th>
                            <th>包装单位</th>
                            <th>生产厂家</th>
                            <th>采购供应商</th>
                            <th>进货价</th>
                            <th>计划数量</th>
                            <th>审核数量</th>
                            <th>计划金额</th>
                            <th>采购数量</th>
                            <th>采购金额</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="drugBuyPlan">
                        <tr>
                            <td>${drugBuyPlan.purchaseOrder}</td>
                            <td> ${drugBuyPlan.drugCode}</td>
                            <td> ${drugBuyPlan.drugName}</td>
                            <td> ${drugBuyPlan.packageSpec}</td>
                            <td> ${fns:getDictLabel(drugBuyPlan.packageUnit, 'SPEC_UNIT', '')}</td>
                            <td> ${his_fns:getSupplierById(drugBuyPlan.vedorName)}</td>
                            <td> ${drugBuyPlan.supplierName}</td>
                            <td> ${drugBuyPlan.costPrice}</td>
                            <td> ${drugBuyPlan.plannedSelling}</td>
                            <td> ${drugBuyPlan.auditSelling}</td>
                            <td> ${drugBuyPlan.plannedAmount}</td>
                            <td> ${drugBuyPlan.purchaseSelling}</td>
                            <td> ${drugBuyPlan.purchaseAmount}</td>
                            <td>
                                <c:if test="${drugBuyPlan.stateFlag=='0'}">已计划</c:if>
                                <c:if test="${drugBuyPlan.stateFlag=='1'}">已调整</c:if>
                                <c:if test="${drugBuyPlan.stateFlag=='2'}">已审核</c:if>
                                <c:if test="${drugBuyPlan.stateFlag=='3'}">已执行</c:if>
                                <c:if test="${drugBuyPlan.stateFlag=='4'}">已入库</c:if>
                            </td>
                        </tr>
                        </c:forEach>

                    </table>
                    <div class="pagination">${page}</div>
                </div>
            </div>
        </section>
    </div>
</div>